<!doctype html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>PyWebIO Application</title>
    <link rel="icon" type="image/png" sizes="32x32"
          href=""
          id="favicon32">
    <link rel="icon" type="image/png" sizes="16x16"
          href=""
          id="favicon16">
    <link rel="stylesheet" href="css/markdown.min.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/codemirror.min.css">
    <link rel="stylesheet" href="codemirror/base16-light.min.css">
    <link rel="stylesheet" href="css/toastify.min.css">
    <link rel="stylesheet" href="css/app.css">
</head>
<body>
<div class="pywebio">
    <div class="container no-fix-height" id="output-container">
        <div class="markdown-body" id="markdown-body">
            <div class="alert alert-warning" role="alert">
                警告：您正在使用旧版本的方式来实现PyWebIO与Web框架整合，此方式在当前版本中已经不被推荐，并在将来可能会被移除。<br/>
                请访问<a href="https://pywebio.readthedocs.io/zh_CN/latest/guide.html#web" target="_blank" class="alert-link">此处</a>来查看新版本PyWebIO中与Web框架整合更简单的方式。
            </div>
            <div id="pywebio-scope-ROOT"></div>
        </div>
        <div id="end-space"></div>

    </div>

    <div id="input-container">
        <div id="input-cards" class="container"></div>
    </div>
</div>


<footer class="footer">
    Powered by <a href="https://github.com/wang0618/PyWebIO" target="_blank">PyWebIO</a>
</footer>

<script src="js/mustache.min.js"></script>  <!--template system-->
<script src="js/codemirror.min.js"></script>  <!--code textarea editor-->
<script src="codemirror/matchbrackets.js"></script>  <!--codemirror plugin-->
<script src="codemirror/python.js"></script> <!--codemirror python language support-->
<script src="codemirror/loadmode.js"></script> <!--codemirror plugin: auto load mode-->
<script src="codemirror/active-line.js"></script> <!--codemirror plugin: auto load mode-->
<script src="js/prism.min.js"></script>  <!-- markdown code highlight -->
<script src="js/FileSaver.min.js"></script>  <!-- saving files on the client-side -->
<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>  <!-- tooltip engine -->
<script src="js/bootstrap.min.js"></script>
<script src="js/toastify.min.js"></script> <!-- toast -->
<script src="js/bs-custom-file-input.min.js"></script> <!-- bootstrap custom file input-->
<script src="js/purify.min.js"></script>  <!-- XSS sanitizer -->

<script src="js/pywebio.min.js"></script>

<script src="js/require.min.js"></script> <!-- JS module loader -->
<script>

    require.config({
        paths: {
            'plotly': "https://cdn.jsdelivr.net/npm/plotly.js@1.53.0/dist/plotly.min", // 'https://cdn.plot.ly/plotly-latest.min'
            "bokeh": "https://cdn.jsdelivr.net/npm/@bokeh/bokehjs@2.0.2/build/js/bokeh.min",
            "bokeh-widgets": "https://cdn.jsdelivr.net/npm/@bokeh/bokehjs@2.0.2/build/js/bokeh-widgets.min",
            "bokeh-tables": "https://cdn.jsdelivr.net/npm/@bokeh/bokehjs@2.0.2/build/js/bokeh-tables.min",
            "bokeh-gl": "https://cdn.jsdelivr.net/npm/@bokeh/bokehjs@2.0.2/build/js/bokeh-gl.min",
        },
        shim: {
            'bokeh': {
                exports: 'Bokeh'
            },
            'bokeh-widgets': {
                exports: '_',
                deps: ['bokeh'],
            },
            'bokeh-tables': {
                exports: '_',
                deps: ['bokeh'],
            },
            'bokeh-gl': {
                exports: '_',
                deps: ['bokeh'],
            },
        }
    });


    $(function () {
        // https://www.npmjs.com/package/bs-custom-file-input
        bsCustomFileInput.init()
    });

    const urlparams = new URLSearchParams(window.location.search);
    WebIO.startWebIOClient({
        output_container_elem: $('#markdown-body'),
        input_container_elem: $('#input-cards'),
        backend_address: urlparams.get('pywebio_api') || './io',
        app_name: urlparams.get('app') || 'index',
        protocol: 'auto',
        runtime_config: {
            debug: urlparams.get('_pywebio_debug'),
            outputAnimation: !urlparams.get('_pywebio_disable_animate'),
            httpPullInterval: parseInt(urlparams.get('_pywebio_http_pull_interval') || 1000)
        },
    });

</script>


</body>
</html>